
class LV60_Cal():
	def __init__(self):
		self.times = 0
		#B2到B12为用户输入
		self.B2 = 0
		self.B3 = 0
		self.B4 = 0
		self.B5 = 0
		self.B6 = 0
		self.B7 = 0
		self.B8 = 0
		self.B9 = 0
		self.B10 = 0
		self.B11 = 0
		self.B12 = 0

		#A19-E20为str，标准评判
		self.A19 = '送去喂鱼'
		self.B19 = '打入冷宫'
		self.C19 = '未来可期'
		self.D19 = '赌狗专用'
		self.E19 = '天选之子'
		self.A20 = 0
		self.B20 = 3.4
		self.C20 = 3.8
		self.D20 = 4.6
		self.E20 = 5.95

		#B26-D43为float，评判的参数对应参考
		self.B26 = 5.50
		self.C26 = 6.10
		self.D26 = 6.40
		self.B27 = 6.40
		self.C27 = 7.10
		self.D27 =7.40
		self.B28 =7.30
		self.C28 =8.10
		self.D28 =8.40
		self.B29 =8.20
		self.C29 =9.10
		self.D29 =9.40
		self.B30 =9.10
		self.C30 =10.10
		self.D30 =10.40
		self.B31 = 10.00
		self.C31 =11.10
		self.D31 =11.50
		self.B32 =6.20
		self.C32 =7.40
		self.D32 =7.40
		self.B33 =7.20
		self.C33 =8.30
		self.D33 =8.40
		self.B34 =8.10
		self.C34 =9.25
		self.D34 =9.40
		self.B35 =9.05
		self.C35 =10.20
		self.D35 =10.40
		self.B36 =10.00
		self.C36 =11.15
		self.D36 =11.40
		self.B37 =11.00
		self.C37 =12.10
		self.D37 =12.40
		self.B38 =7.10
		self.C38 =8.30
		self.D38 =8.40
		self.B39 =8.00
		self.C39 =9.25
		self.D39 =9.40
		self.B40 =9.00
		self.C40 =10.25
		self.D40 =10.40
		self.B41 =10.00
		self.C41 =11.220
		self.D41 =11.40
		self.B42 =11.00
		self.C42 =12.15
		self.D42 =12.40
		self.B43 =12.00
		self.C43 =13.10
		self.D43 =13.40

		#不可变动的基础属性
		self.H25 = 60
		self.H26 = 679
		self.H27 = 338
		self.H28 = 13596

		#每次计算前需要清空的参数
		self.D4 = None
		self.D5 = None
		self.D6 = None
		self.D7 = None
		self.D8 = None
		self.D9 = None
		self.D10 = None
		self.D11 = None
		self.B14 = None
		self.B15 = None
		self.B16 = None
		self.B17 = None
		self.E14 = None
		self.E15 = None
		self.E16 = None
		self.E17 = None
		self.F15 = None


	def run(self,xiaoshengming=0,xiaogongji=0,xiaofangyu=0,baoji=0,baoshang=0,dashengming=0,dagongji=0,dafangyu=0,xuruo=0,shiyue=0,level=0):
		if xiaoshengming == '':
			xiaoshengming = 0
		if xiaogongji == '':
			xiaogongji =0
		if xiaofangyu == '':
			xiaofangyu =0
		if baoji == '':
			baoji =0
		if baoshang == '':
			baoshang = 0
		if dashengming == '':
			dashengming = 0
		if dagongji == '':
			dagongji = 0
		if dafangyu == '':
			dafangyu = 0
		if xuruo == '':
			xuruo = 0
		if shiyue == '':
			shiyue = 0
		if level == '':
			level = 0

		self._clear_cal()
		self.input_data(float(xiaoshengming),float(xiaogongji),float(xiaofangyu),float(baoji),float(baoshang),float(dashengming),float(dagongji),float(dafangyu),float(xuruo),float(shiyue),int(level))
		citiaoshu = self.calculate_initial_value()
		shuangsheng = self.shuangsheng_calculate_value()
		shuanggong = self.shuangggong_calculate_value()
		shuangfang = self.shuangfang_calculate_value()
		self.max_3()
		xing_zhuguang = self.xing_zhuguang_calculate_composite_score()
		li_xianzhi = self.li_xianzhi_calculate_composite_score()
		yu_shenhai = self.yu_shenhai_calculate_composite_score()
		yu_shendian = self.yu_shendian_calculate_composite_score()
		zhuguang_shenhai = self.zhuguang_shenhai_result()
		xianzhi_moye = self.xianzhi_moye_result()
		shendian = self.shendian_result()
		cankaozhi = self.cankaozhi()
		cankaozhi_str = self.cankaozhi_str_result()
		self.times = self.times + 1
		print(self.times,shuangsheng,shuanggong,shuangfang,xing_zhuguang,li_xianzhi,yu_shenhai,yu_shendian,zhuguang_shenhai,xianzhi_moye,shendian,cankaozhi,cankaozhi_str)
		return citiaoshu,shuangsheng,shuanggong,shuangfang,xing_zhuguang,li_xianzhi,yu_shenhai,yu_shendian,zhuguang_shenhai,xianzhi_moye,shendian,cankaozhi,cankaozhi_str
		#zhuguang_shenhai,xianzhi_moye,shendian

	#step 1
	def _clear_cal(self):
		self.D4 = None
		self.D5 = None
		self.D6 = None
		self.D7 = None
		self.D8 = None
		self.D9 = None
		self.D10 = None
		self.D11 = None
		self.B14 = None
		self.B15 = None
		self.B16 = None
		self.B17 = None
		self.E14 = None
		self.E15 = None
		self.E16 = None
		self.E17 = None
		self.F15 = None

	#step 2 输入数据
	def input_data(self,xiaoshengming,xiaogongji,xiaofangyu,baoji,baoshang,dashengming,dagongji,dafangyu,xuruo,shiyue,level):
		self.B2 = xiaoshengming
		self.B3 = xiaogongji
		self.B4 = xiaofangyu
		self.B5 = baoji
		self.B6 = baoshang
		self.B7 = dashengming
		self.B8 = dagongji
		self.B9 = dafangyu
		self.B10 = xuruo
		self.B11 = shiyue
		self.B12 = level

	#B14 result 星-逐光 step8
	def xing_zhuguang_calculate_composite_score(self):
		part1 = self.B3 / self.H26 * 100 / 4.2
		part2 = self.B5 / 0.65
		part3 = self.B6 / 1.3
		part4 = self.B8 / 4.2
		part5 = self.B10 / 1.1
		part6 = self.B11 / 0.5
		self.B14 = part1 + part2 + part3 + part4 + part5 + part6

		return self.B14

	#B15 result 黎-先知 step9
	def li_xianzhi_calculate_composite_score(self):
		part1 = self.B3 / self.H26 * 100 / 4.2
		part2 = self.B4 / self.H27 * 100 / 4.2
		part3 = self.B5 / 0.65
		part4 = self.B6 / 1.3
		part5 = self.B8 / 4.2
		part6 = self.B9 / 4.2
		part7 = self.B10 / 1.1
		part8 = self.B11 / 0.5
		self.B15 = part1 + part2 + part3 + part4 + part5 + part6 + part7 + part8

		return self.B15

	#B16 result 鱼-深海 step10
	def yu_shenhai_calculate_composite_score(self):
		part1 = self.B3 / self.H26 * 100 / 4.2
		part2 = self.B5 / 0.65
		part3 = self.B6 / 1.3
		part4 = self.B8 / 4.2
		part5 = self.B10 / 1.1
		part6 = self.B11 / 0.5
		self.B16 = part1 + part2 + part3 + part4 + part5 + part6

		return self.B16

	#B17 step11
	def yu_shendian_calculate_composite_score(self):
		self.B17 = (
				self.B2 / self.H28 * 100 / 4.2 +
				self.B3 / self.H26 * 100 / 4.2 +
				self.B5 / 0.65 +
				self.B6 / 1.3 +
				self.B7 / 4.2 +
				self.B8 / 4.2 +
				self.B10 / 1.1 +
				self.B11 / 0.5
		)
		return self.B17

	#E14 step3 result 计算初始词条 词条数判断
	def calculate_initial_value(self):
		num = 0
		cells = [self.B2, self.B3, self.B4, self.B5, self.B6, self.B7, self.B8, self.B9, self.B10, self.B11]
		for cell in cells:
			if cell != 0:
				num = num + 1
		self.E14 = num
		return self.E14

	#E15 result 双生计算 step4
	def shuangsheng_calculate_value(self):
		self.E15 = (self.B2 / self.H28 * 100 / 4.2) + (self.B7 / 4.2)
		return self.E15

	#E16 result  双攻计算 step5
	def shuangggong_calculate_value(self):
		self.E16 = (self.B3 / self.H26 * 100 / 4.2) + (self.B8 / 4.2)
		return self.E16

	#E17 result 双防计算 step6
	def shuangfang_calculate_value(self):
		self.E17 = (self.B4 / self.H27 * 100 / 4.2) + (self.B9 / 4.2)
		return self.E17

	#F15 step7
	def max_3(self):
		self.F15 = max(self.E15, self.E16, self.E17)
		return self.F15

	#D4 result 逐光/深海 step12
	def zhuguang_shenhai_result(self):
		result = self._zhuguang_shenhai()
		self.D4 = result
		return self.D4

	def _zhuguang_shenhai(self):
		if self.E14 == 2:
			if self.B12 < 3:
				if self.B14 >= self.C26:
					return "优选"
				elif self.B14 >= self.B26:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 < 6:
				if self.B14 >= self.C27:
					return "优选"
				elif self.B14 >= self.B27:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 < 9:
				if self.B14 >= self.C28:
					return "优选"
				elif self.B14 >= self.B28:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 < 12:
				if self.B14 >= self.C29:
					return "优选"
				elif self.B14 >= self.B29:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 < 15:
				if self.B14 >= self.C30:
					return "优选"
				elif self.B14 >= self.B30:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 == 15:
				if self.B14 >= self.C31:
					return "优选"
				elif self.B14 >= self.B31:
					return "可用"
				else:
					return "狗粮"
		elif self.E14 == 3:
			if self.B12 < 3:
				if self.B14 >= self.C32:
					return "优选"
				elif self.B14 >= self.B32:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 < 6:
				if self.B14 >= self.C33:
					return "优选"
				elif self.B14 >= self.B33:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 < 9:
				if self.B14 >= self.C34:
					return "优选"
				elif self.B14 >= self.B34:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 < 12:
				if self.B14 >= self.C35:
					return "优选"
				elif self.B14 >= self.B35:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 < 15:
				if self.B14 >= self.C36:
					return "优选"
				elif self.B14 >= self.B36:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 == 15:
				if self.B14 >= self.C37:
					return "优选"
				elif self.B14 >= self.B37:
					return "可用"
				else:
					return "狗粮"
		elif self.E14 == 4:
			if self.B12 < 3:
				if self.B14 >= self.C38:
					return "优选"
				elif self.B14 >= self.B38:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 < 6:
				if self.B14 >= self.C39:
					return "优选"
				elif self.B14 >= self.B39:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 < 9:
				if self.B14 >= self.C40:
					return "优选"
				elif self.B14 >= self.B40:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 < 12:
				if self.B14 >= self.C41:
					return "优选"
				elif self.B14 >= self.B41:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 < 15:
				if self.B14 >= self.C42:
					return "优选"
				elif self.B14 >= self.B42:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 == 15:
				if self.B14 >= self.C43:
					return "优选"
				elif self.B14 >= self.B43:
					return "可用"
				else:
					return "狗粮"

	#D5 result 先知/末夜 step13
	def xianzhi_moye_result(self):
		self.D5 = self._xianzhi_moye()
		return self.D5

	def _xianzhi_moye(self):
		if self.E14 == 2:
			if self.B12 < 3:
				if self.B15 >= self.C26:
					return "优选"
				elif self.B15 >= self.B26:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 < 6:
				if self.B15 >= self.C27:
					return "优选"
				elif self.B15 >= self.B27:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 < 9:
				if self.B15 >= self.C28:
					return "优选"
				elif self.B15 >= self.B28:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 < 12:
				if self.B15 >= self.C29:
					return "优选"
				elif self.B15 >= self.B29:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 < 15:
				if self.B15 >= self.C30:
					return "优选"
				elif self.B15 >= self.B30:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 == 15:
				if self.B15 >= self.C31:
					return "优选"
				elif self.B15 >= self.B31:
					return "可用"
				else:
					return "狗粮"
		elif self.E14 == 3:
			if self.B12 < 3:
				if self.B15 >= self.C32:
					return "优选"
				elif self.B15 >= self.B32:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 < 6:
				if self.B15 >= self.C33:
					return "优选"
				elif self.B15 >= self.B33:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 < 9:
				if self.B15 >= self.C34:
					return "优选"
				elif self.B15 >= self.B34:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 < 12:
				if self.B15 >= self.C35:
					return "优选"
				elif self.B15 >= self.B35:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 < 15:
				if self.B15 >= self.C36:
					return "优选"
				elif self.B15 >= self.B36:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 == 15:
				if self.B15 >= self.C37:
					return "优选"
				elif self.B15 >= self.B37:
					return "可用"
				else:
					return "狗粮"
		elif self.E14 == 4:
			if self.B12 < 3:
				if self.B15 >= self.C38:
					return "优选"
				elif self.B15 >= self.B38:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 < 6:
				if self.B15 >= self.C39:
					return "优选"
				elif self.B15 >= self.B39:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 < 9:
				if self.B15 >= self.C40:
					return "优选"
				elif self.B15 >= self.B40:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 < 12:
				if self.B15 >= self.C41:
					return "优选"
				elif self.B15 >= self.B41:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 < 15:
				if self.B15 >= self.C42:
					return "优选"
				elif self.B15 >= self.B42:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 == 15:
				if self.B15 >= self.C43:
					return "优选"
				elif self.B15 >= self.B43:
					return "可用"
				else:
					return "狗粮"

	#D6 result 神殿 step14
	def shendian_result(self):
		self.D6 = self._shendian()
		return self.D6

	def _shendian(self):
		if self.E14 == 2:
			if self.B12 < 3:
				if self.B17 >= self.C26:
					return "优选"
				elif self.B17 >= self.B26:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 < 6:
				if self.B17 >= self.C27:
					return "优选"
				elif self.B17 >= self.B27:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 < 9:
				if self.B17 >= self.C28:
					return "优选"
				elif self.B17 >= self.B28:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 < 12:
				if self.B17 >= self.C29:
					return "优选"
				elif self.B17 >= self.B29:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 < 15:
				if self.B17 >= self.C30:
					return "优选"
				elif self.B17 >= self.B30:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 == 15:
				if self.B17 >= self.C31:
					return "优选"
				elif self.B17 >=self.B31:
					return "可用"
				else:
					return "狗粮"
		elif self.E14 == 3:
			if self.B12 < 3:
				if self.B17 >= self.C32:
					return "优选"
				elif self.B17 >= self.B32:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 < 6:
				if self.B17 >= self.C33:
					return "优选"
				elif self.B17 >= self.B33:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 < 9:
				if self.B17 >= self.C34:
					return "优选"
				elif self.B17 >= self.B34:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 < 12:
				if self.B17 >= self.C35:
					return "优选"
				elif self.B17 >= self.B35:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 < 15:
				if self.B17 >= self.C36:
					return "优选"
				elif self.B17 >= self.B36:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 == 15:
				if self.B17 >= self.C37:
					return "优选"
				elif self.B17 >= self.B37:
					return "可用"
				else:
					return "狗粮"
		elif self.E14 == 4:
			if self.B12 < 3:
				if self.B17 >= self.C38:
					return "优选"
				elif self.B17 >= self.B38:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 < 6:
				if self.B17 >= self.C39:
					return "优选"
				elif self.B17 >= self.B39:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 < 9:
				if self.B17 >= self.C40:
					return "优选"
				elif self.B17 >= self.B40:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 < 12:
				if self.B17 >= self.C41:
					return "优选"
				elif self.B17 >= self.B41:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 < 15:
				if self.B17 >= self.C42:
					return "优选"
				elif self.B17 >= self.B42:
					return "可用"
				else:
					return "狗粮"
			elif self.B12 == 15:
				if self.B17 >= self.C43:
					return "优选"
				elif self.B17 >= self.B43:
					return "可用"
				else:
					return "狗粮"

	#D7 result 参考值 step15
	def cankaozhi(self):
		self.D7 = (self.B2 / self.H28 * 100 / 4.2) + (self.B3 / self.H26 * 100 / 4.2) + (self.B4 / self.H27 * 100 / 4.2) + (self.B5 / 0.65) + (self.B6 / 1.3) + (
					self.B7 / 4.2) + (self.B8 / 4.2) + (self.B9 / 4.2) + (self.B10 / 1.1) + (self.B11 / 0.5)
		return self.D7

	#D11 result step16
	def cankaozhi_str_result(self):
		self.D11 = self._cur_status_str()
		return self.D11
	def _cur_status_str(self):
		if self.F15 < self.B20:
			return self.A19
		elif self.F15 < self.C20:
			return self.B19
		elif self.F15 < self.D20:
			return self.C19
		elif self.F15 < self.E20:
			return self.D19
		else:
			return self.E19

if __name__ == "__main__":
	cal = Cal()
	cal.run(xiaoshengming=1600,baoji = 10,baoshang=10,dashengming=20)
